﻿using Bulb.Core.Services.CollectionService;
using Cirrious.MvvmCross.Localization;
using Cirrious.MvvmCross.ViewModels;

namespace Bulb.Core.ViewModels
{
    public class BaseViewModel : MvxViewModel
    {
        protected readonly ICollectionService CollectionService;

        public BaseViewModel(ICollectionService collectionService)
        {
            CollectionService = collectionService;
        }

        public IMvxLanguageBinder TextSource
        {
            get { return new MvxLanguageBinder(Constants.GeneralNamespace, GetType().Name); }
        }

        protected bool Validate(string name)
        {
            return !string.IsNullOrEmpty(name);
        }
    }
}
